//    Openbravo POS is a point of sales application designed for touch screens.
//    Copyright (C) 2007-2009 Openbravo, S.L.
//    http://www.openbravo.com/product/pos
//
//    This file is part of Openbravo POS.
//
//    Openbravo POS is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    Openbravo POS is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with Openbravo POS.  If not, see <http://www.gnu.org/licenses/>.

package com.openbravo.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 *
 * @author adrianromero
 */
public class PaymentsModel {

    private String m_sHost;
    private int m_iSeq;
    private Date m_dDateStart;
    private Date m_dDateEnd;

    private String m_sName;
            
    private Integer m_iPayments;
    private Double m_dPaymentsTotal;
    private java.util.List<PaymentsLine> m_lpayments;

    private double m_dHandCash;
    private String memo;

    private final static String[] PAYMENTHEADERS = {"Label.Payment", "label.totalcash"};
    
    private Integer m_iSales;
    private Double m_dSalesBase;
    private Double m_dSalesTaxes;
    private java.util.List<SalesLine> m_lsales;
    

    public PaymentsModel() {
    }    
    
    public static PaymentsModel emptyInstance() {
        
        PaymentsModel p = new PaymentsModel();
        
        p.m_iPayments = new Integer(0);
        p.m_dPaymentsTotal = new Double(0.0);
        p.m_lpayments = new ArrayList<PaymentsLine>();

        p.m_sName=null;
        p.m_iSales = null;
        p.m_dSalesBase = null;
        p.m_dSalesTaxes = null;
        p.m_lsales = new ArrayList<SalesLine>();
        p.m_dHandCash=0;
        p.memo=null;

        return p;
    }

    public int getPayments() {
        return m_iPayments.intValue();
    }
    public double getTotal() {
        return m_dPaymentsTotal.doubleValue();
    }
    public String getHost() {
        return m_sHost;
    }
    public int getSequence() {
        return m_iSeq;
    }
    public Date getDateStart() {
        return m_dDateStart;
    }
    public void setDateEnd(Date dValue) {
        m_dDateEnd = dValue;
    }
    public Date getDateEnd() {
        return m_dDateEnd;
    }
    
    public List<PaymentsLine> getPaymentLines() {
        return m_lpayments;
    }
    
    public int getSales() {
        return m_iSales == null ? 0 : m_iSales.intValue();
    }    
    
    public List<SalesLine> getSaleLines() {
        return m_lsales;
    }

	public String getM_sHost() {
		return m_sHost;
	}

	public void setM_sHost(String m_sHost) {
		this.m_sHost = m_sHost;
	}

	public int getM_iSeq() {
		return m_iSeq;
	}

	public void setM_iSeq(int m_iSeq) {
		this.m_iSeq = m_iSeq;
	}

	public Date getM_dDateStart() {
		return m_dDateStart;
	}

	public void setM_dDateStart(Date m_dDateStart) {
		this.m_dDateStart = m_dDateStart;
	}

	public Date getM_dDateEnd() {
		return m_dDateEnd;
	}

	public void setM_dDateEnd(Date m_dDateEnd) {
		this.m_dDateEnd = m_dDateEnd;
	}

	public String getM_sName() {
		return m_sName;
	}

	public void setM_sName(String m_sName) {
		this.m_sName = m_sName;
	}

	public Integer getM_iPayments() {
		return m_iPayments;
	}

	public void setM_iPayments(Integer m_iPayments) {
		this.m_iPayments = m_iPayments;
	}

	public Double getM_dPaymentsTotal() {
		return m_dPaymentsTotal;
	}

	public void setM_dPaymentsTotal(Double m_dPaymentsTotal) {
		this.m_dPaymentsTotal = m_dPaymentsTotal;
	}

	public java.util.List<PaymentsLine> getM_lpayments() {
		return m_lpayments;
	}

	public void setM_lpayments(java.util.List<PaymentsLine> m_lpayments) {
		this.m_lpayments = m_lpayments;
	}

	public double getM_dHandCash() {
		return m_dHandCash;
	}

	public void setM_dHandCash(double m_dHandCash) {
		this.m_dHandCash = m_dHandCash;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Integer getM_iSales() {
		return m_iSales;
	}

	public void setM_iSales(Integer m_iSales) {
		this.m_iSales = m_iSales;
	}

	public Double getM_dSalesBase() {
		return m_dSalesBase;
	}

	public void setM_dSalesBase(Double m_dSalesBase) {
		this.m_dSalesBase = m_dSalesBase;
	}

	public Double getM_dSalesTaxes() {
		return m_dSalesTaxes;
	}

	public void setM_dSalesTaxes(Double m_dSalesTaxes) {
		this.m_dSalesTaxes = m_dSalesTaxes;
	}

	public java.util.List<SalesLine> getM_lsales() {
		return m_lsales;
	}

	public void setM_lsales(java.util.List<SalesLine> m_lsales) {
		this.m_lsales = m_lsales;
	}
    
}    